package cn.lzy.study.datasource.controller;

import cn.lzy.study.datasource.entity.User;
import cn.lzy.study.datasource.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author LZY
 * @since 2022-08-13
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;


    @GetMapping("/list")
    public List<User> list() {
        System.out.println("查询数据");
        List<User> list = userService.getAllUser2();
        System.out.println(list);
        return list;
    }
}
